path=$(dirname $(realpath "$0"))
k=$1
t=$2

python $path/preprocess.py $k $t
~/software/UWHAM-and-SWHAM/uwham -d ${k}.info -q 200 -m 1 -e 1.0e-10 -w 0 | tee weight.log
mv weights.data ${k}_weights.data
python $path/reweight.py $k $t
python $path/Histogram.py -f ${k}_weights.txt -i 2 -w ${k}_weights.txt -j 4 -b 100 -e -t $t > ${k}_dw_us_uwham.hist
python $path/Histogram.py -f ${k}_weights.txt -i 1 -w ${k}_weights.txt -j 4 -b 100 -e -t $t > ${k}_xi_dw_us_uwham.hist
python $path/2DHistogram.py -t $t -f ${k}_weights.txt -i 2,3 -w ${k}_weights.txt -j 4 -n -2.1415926,-2.1415926 -x 2.1415926,2.1415926 -b 60,60 -e -o 1 > ${k}_AlaD_re_uwham.hist
grep -v inf ${k}_AlaD_re_uwham.hist > ${k}_uAlaD_re_uwham.hist
python $path/new_plot.py $k $t
python $path/scatter.py $k $t
rm ${k}_weights.data
# rm ${k}.npz
# rm ${k}_sum.npz
rm ${k}_weights.txt
rm ${k}.info

